/*
 * Constants.java
 *
 * Created on 19 marzo 2004, 12.02
 */

package net.ermannofranco.xml.schema;

/** Uso degli attributi.
 * @author ermanno (ermanno.franco@gmail.com)
 */
public enum Use {
	
	REQUIRED,OPTIONAL,PROHIBITED;
  /** required */
//  public static final int REQ=1;
//  /** optional */
//  public static final int OPT=2;
//  /** prohibited */
//  public static final int PROHIB=3;
 
  
  /** restituisce la stringa corrispondente
   * @param useType parametro intero
   * @return optional,required,prohibited o eccezione
   */
  protected static String getString(Use useType) {
    switch  (useType) {
      case REQUIRED:
	return "required";
      case OPTIONAL:
	return "optional";
      case PROHIBITED:
	return "prohibited";
      default:
	throw new SchemaException("Uso non accettato");
    }
    //return null;    
  }
}
